package com.faya.green.service.impl;

import com.faya.green.dao.authority.RoleUserDao;
import com.faya.green.model.RoleUser;
import com.faya.green.service.RoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ：LX
 * 创建时间： 2018/8/25. 0:21
 * 地点：广州
 * 目的: 角色与用户关系
 * 备注说明：
 */
@Service
public class RoleUserServiceImpl implements RoleUserService {

    //压制全部警告
    @SuppressWarnings("all")
    @Autowired
    private RoleUserDao roleUserDao;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void updateRoleUser(RoleUser roleUser) {
        roleUserDao.updateRoleUser(roleUser);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void addRoleUser(RoleUser roleUser) {
        roleUserDao.addRoleUser(roleUser);
    }

    @Override
    public List<RoleUser> getRoleUserById(String id) {
        return roleUserDao.getRoleUserById(id);
    }
}
